package java67_adv5;

import java.math.BigDecimal;

public class DoublTest {

	public static void main(String[] args) {
		double d1 = 1.123 / 3;
		System.out.println(d1);
		double d2 = d1 * 3;
		System.out.println(d2);
		System.out.println(">>>>>>>>>>>>");
		BigDecimal b = new BigDecimal(1.123);
		BigDecimal t1 = b.divide(new BigDecimal(3), 20, BigDecimal.ROUND_HALF_UP);
		System.out.println(t1);
		BigDecimal t2 = t1.multiply(new BigDecimal(3));
		System.out.println(t2);
	}

}
